<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath(); 
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>"> 
<meta charset="UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">  
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="css/maintable.css" >
<script type="text/javascript" src="js/jquery-1.8.0.js"></script> 
<script type="text/javascript">
	$(function(){
		$("table tr").mouseover(function(){
			$(this).css("background","#D3EAEF");
			$(this).siblings().css("background","white");
		});
		});
</script>
</head>
<body>
<div class ="div_title">
	<div class="div_titlename"> <img src="images/san_jiao.gif" ><span>系统中的角色列表</span></div>
	<div class="div_titleoper"></div>
</div>
<table class="main_table" >
	<tr>
		<th>角色名称</th> 	<th>角色描述</th>	<th>操作</th>
	</tr>
	<c:forEach var="a" items="${roleList }" varStatus="st">
	<tr>
		<td>
			${a.roleName }
		</td>
		<td>
			<a title="${a.des}">
 				<c:if test="${fn:length(a.des) > 10 }">
					${fn:substring(a.des,0,10)}...
				</c:if>
				<c:if test="${fn:length(a.des)  <= 10 }">
					${a.des}
				</c:if>
			</a>			
		</td>
		<td>
			<a href="RoleServlet.do?flag=searchForUpdate&id=${a.id}">修改</a> | 
			<a href="RoleServlet.do?flag=delete&amp;pageIndex=${page.pageIndex}&amp;id=${a.id}">删除</a> | 
			<a href="RoleServlet.do?flag=roleForUpdate&amp;id=${a.id}">角色权限分配</a>
		</td>
	</tr>
	</c:forEach>
</table>
</body>
</html>